//package com.funny.stock.trade.controller;
//
//import com.funny.stock.base.util.PageUtil;
//import com.funny.stock.base.util.ResultUtil;
//import com.funny.stock.base.vo.Result;
//import com.funny.stock.trade.service.ComposeAssetsActionService;
//import com.funny.stock.trade.vo.ComposeAssetsActionVO;
//import com.funny.stock.user.util.UserSecurityUtil;
//
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.domain.Page;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PathVariable;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.bind.annotation.RestController;
//
///**
// * @author pengl
// * @date 2020/05/17
// **/
//@RestController
//@RequestMapping("/compose/assets/action")
//public class ComposeAssetsActionController {
//    public static final Logger logger = LoggerFactory.getLogger(ComposeAssetsActionController.class);
//
//    @Autowired
//    ComposeAssetsActionService actionService;
//
////    @Autowired
////    ComposeAssetsService assetsService;
//
//
////    @PostMapping("/add")
////    public Result<ComposeAssetsActionVO> add(@RequestBody ComposeAssetsActionVO dataObj){
//////        SysUserVO user = UserSecurityUtil.getUser(httpSession);
////        Long userId = UserSecurityUtil.getUserId();
////
////        dataObj.setCreateId(userId);
////        dataObj.setCreateDate(new Date());
////        dataObj.setUpdateId(userId);
////        dataObj.setUpdateDate(new Date());
////
////        ComposeAssetsVO assetsVO = assetsService.findByCreateIdAndId(userId,dataObj.getAssetsId());
////
////        if(assetsVO == null)
////            return ResultUtil.error("资产不存在");
////
////        TradeType tradeType = TradeType.of(dataObj.getAction());
////        if(tradeType == null)
////            return ResultUtil.error("不支持的交易方式");
////
////        if(dataObj.getMoney() == null)
////            return ResultUtil.error("金额数据为空");
////
////        assetsVO.setUpdateId(userId);
////        assetsVO.setUpdateTime(new Date());
////        ComposeAssetsActionVO result = actionService.save(dataObj, assetsVO);
////        return ResultUtil.success(result);
////    }
//
//
//
//
//    @GetMapping("/{id}")
//    public Result<ComposeAssetsActionVO> detail(@PathVariable Long id){
//        Long userId = UserSecurityUtil.getUserId();
//        ComposeAssetsActionVO detailVO = actionService.findByCreateIdAndId(userId,id);
//        return ResultUtil.success(detailVO);
//    }
//
//    @GetMapping("/listByPage")
//    public Result<Page<ComposeAssetsActionVO>> listByPage(@RequestParam(defaultValue = "1") Integer pageNum,
//                                                     @RequestParam(defaultValue = "20") Integer pageSize){
//
//        Page<ComposeAssetsActionVO> page = actionService.findAll(PageUtil.buildPageRequest(pageNum, pageSize));
//        return ResultUtil.success(page);
//    }
//
//
//    @PostMapping("/queryByPage")
//    public Result<Page<ComposeAssetsActionVO>> myListByPage(@RequestParam(defaultValue = "1") Integer pageNum,
//                                                       @RequestParam(defaultValue = "20") Integer pageSize,
//                                                       @RequestBody ComposeAssetsActionVO queryVO){
//
//        Long userId = UserSecurityUtil.getUserId();
//        queryVO.setCreateId(userId);
//
//        Page<ComposeAssetsActionVO> page = actionService.queryByCondition(queryVO,pageNum, pageSize);
//        return ResultUtil.success(page);
//    }
//
//}
